import { createApp } from 'vue'
import { createPinia } from 'pinia'
import router from './router'
import App from './App.vue'
import './assets/styles/main.scss'

// 引入Vant
import { 
  Button,
  Form,
  Field,
  CellGroup,
  Cell,
  Tabbar, 
  TabbarItem,
  NavBar,
  Search,
  Swipe,
  SwipeItem,
  Grid,
  GridItem,
  Card,
  Tag,
  Icon,
  DropdownMenu,
  DropdownItem,
  List,
  PullRefresh,
  Image as VanImage,
  ActionSheet,
  Dialog,
  Toast,
  Tab,
  Tabs,
  Popup,
  Calendar,
  Progress,
  Switch,
  Picker,
  Collapse,
  CollapseItem,
  Rate,
  Uploader,
  Checkbox,
  CheckboxGroup,
  Radio,
  RadioGroup,
  SubmitBar,
  CountDown,
  ShareSheet
} from 'vant'
import 'vant/lib/index.css'

const app = createApp(App)

// 注册Vant组件
const vantComponents = [
  Button,
  Form,
  Field,
  CellGroup,
  Cell,
  Tabbar,
  TabbarItem,
  NavBar,
  Search,
  Swipe,
  SwipeItem,
  Grid,
  GridItem,
  Card,
  Tag,
  Icon,
  DropdownMenu,
  DropdownItem,
  List,
  PullRefresh,
  VanImage,
  ActionSheet,
  Dialog,
  Toast,
  Tab,
  Tabs,
  Popup,
  Calendar,
  Progress,
  Switch,
  Picker,
  Collapse,
  CollapseItem,
  Rate,
  Uploader,
  Checkbox,
  CheckboxGroup,
  Radio,
  RadioGroup,
  SubmitBar,
  CountDown,
  ShareSheet
]

vantComponents.forEach(component => {
  app.use(component)
})

app.use(createPinia())
app.use(router)

app.mount('#app')
